// pages/inform/inform.js
Page({

  data: {
    len:'',
    isSelect:false,
    inform:[]
  },

  onLoad(){
    var that = this;
    //加载公告信息
    wx.request({
      url: 'http://127.0.0.1:8080/inform/inform',
      method:"GET",
      success(res){
        for(var i=0;i<res.data.length;i++){
          res.data[i].isSelect = false
        }
        that.setData({
          inform:res.data
        })
        // console.log(res)
      }
    })
  },
  choose(e){
    var that = this;
    var index = e.currentTarget.dataset.index
    var value = this.data.inform[index].isSelect
    var target = 'inform['+index+'].isSelect'
    // console.log(index)
    this.setData({
      [target]:!value
    })
    
  }

})